package com.tjian.fafa.user.util.login;

import com.tjian.fafa.user.base.mainBody.FrdRequestNotifActivity;
import com.tjian.fafa.user.base.mainBody.MainBodyActivity;
import com.tjian.fafa.user.base.mainBody.MainBodyService;
import com.tjian.fafa.user.base.util.DbSaveOldMsg;

public class LoginActivityUtil
{
    private static LoginActivityUtil mInstance;

    public static LoginActivityUtil getInstance()
    {
        return mInstance;
    }

    //退出登录;
    public static void logout()
    {
        MainBodyService.getInstance().saveOldMsgs();
        MainBodyService.getInstance().saveTabMsgItems();
        MainBodyService.getInstance().saveFrdNotifItems();
        MainBodyService.getInstance().saveUnreadMsgAm();
        FrdRequestNotifActivity.clearListOfNotif();
        DbSaveOldMsg.getInstance().close();
        MainBodyActivity.getInstance().gotoMyLoginPageActivity();
        android.os.Process.killProcess(android.os.Process.myPid()); // 获取PID
        System.exit(0); // 常规java、c#的标准退出法，返回值为0代表正常退出
    }
}
